<script>
  import $ from 'dfish-widget'
  import Widget from '../Widget.vue'
  import Pickbox from './Pickbox.vue'

  export default {
    mixins: [Pickbox],
    data() {
      return {
        name: 'Linkbox',
        remark: '可输入的有候选项的表单',
        deprecate: '',
        events: [{
          name: 'input',
          remark: '手动输入时触发',
          option: '(event: Event, value: String)<div>可通过<var>event.value</var>获取value值</div>',
          default: ''
        }, {
          name: 'dblclick:item',
          remark: '双击已选项时触发。设置本事件，已选项有下划线效果',
          option: '(event: Event, value: Object)<div>可通过<var>event.value</var>获取value值</div>',
          default: ''
        }, {
          name: 'keydown',
          remark: '按下按键时触发',
          option: '(event: Event)',
          default: ''
        }],
        methods: [{
          name: 'complete(item)',
          remark: '完成正在输入的内容，增加一个新的已选项',
          option: '<var>item</var>: Object 格式: <var>{value, text}</var>',
          return: 'this'
        }, {
          name: 'closeDrop()',
          remark: '关闭下拉选项窗口',
          option: '',
          default: '',
          return: 'this',
        }]
      }
    },
    created() {
      this.merge([{
        name: 'picker',
        type: 'Function',
        remark: '显示一个操作按钮',
        default: ''
      }, {
        name: 'strict',
        type: 'Boolean',
        remark: '值为true时，只允许匹配成功的值',
        default: 'true'
      }, {
        name: 'model-value / v-model',
        type: 'Object / Array',
        remark: '表单值。多个值可用数组。值的格式: <var>{value, text, forbid}</var>',
        option: '<var>value</var>: (String)值, <var>text</var>: (String)文本, <var>forbid</var>: (Boolean)是否禁用'
      }], 'attrs')
    }
  }
</script>

<style>
</style>
